<?php
namespace tlan_turing\migration;

use Faker\Factory as FakerFactory;
use Faker\Generator as FakerGenerator;
use tlan_turing\migration\command\migrate\Run as MigrateRun;
use tlan_turing\migration\command\migrate\Create as MigrateCreate;
use tlan_turing\migration\command\migrate\Status as MigrateStatus;
use tlan_turing\migration\command\migrate\Rollback as MigrateRollback;

use tlan_turing\migration\command\seed\Create as SeedCreate;
use tlan_turing\migration\command\seed\Run  as SeedRun;
class Service  extends \think\Service
{
    public function boot()
    {
        $this->app->bind(FakerGenerator::class , function (){
           return FakerFactory::create($this->app->config>get('app.faker_locale' , 'zh-CN'));
        });
        $this->app->bind('migration.creator', Creator::class);

        $this->commands([
            MigrateRun::class,
            MigrateCreate::class,
            MigrateStatus::class,
            MigrateRollback::class,

            SeedCreate::class,
            SeedRun::class
        ]);
    }
}